package queries;

public class QueriesAluguel {

	public static final String ATUALIZA_ALUGUEL =
		" UPDATE aluguel           " +
		" SET    mes = ?,          " +
		"        ano = ?,          " +
		"        saldoinicial = ?, " +
		"        saldofinal = ?,   " +
		"        isaberto = ?      " +
		" WHERE  mes = ?           " +
		"        AND ano = ?       ";

	public static final String LISTAR_DEBITOS_ALUGUEL =
		" SELECT iddespesaaluguel,        " +
		"        datadebito,              " +
		"        valor,    		          " +
		"        descricao                " +
		" FROM   despesaaluguel           " +
		" WHERE  datadebito <= ?          " +
		"        AND jaliquidada = false  " +
		" ORDER  BY datadebito            ";

	public static final String BUSCAR_TOT_DESPESAS_LIQUIDAR_ALUGUEL =
		" SELECT SUM(valor) AS total             " +
		" FROM   despesaaluguel                  " +
		" WHERE  jaliquidada = false             " +
		"        AND iddespesaaluguel IN (:IDS:) ";

	public static final String LIQUIDA_DESPESAS_ALUGUEL =
		" UPDATE despesaaluguel                  " +
		" SET    jaliquidada = true,             " +
		"        mes = ?,                        " +
		"        ano = ?                         " +
		" WHERE  jaliquidada = false             " +
		"        AND iddespesaaluguel IN (:IDS:) ";

}
